{% include 'base.html'%}
<div class = "page">
<div class = "header"></div>
<div class="login">
{% load url from future %}
	{% if user.is_authenticated %}	
		<h1> You are logged in as {{user}}</h1>
	<form method = post action="{% url 'interview.views.LogUserOut' %}">
	{% csrf_token %}
		<input name="userAction" type = "submit" value="Logout"/>
	</form>

	{% else %}
	<form method = post action="{% url 'interview.views.LogUserIn' %}">
	{% csrf_token %}
		<table>
		<tr><td align="left">Username:</td><td align="right"><input type="text" name="username" /></td></tr>
		<tr><td align="left">Password:<td align="right"><input type="password" name= "password" /></td></tr>
		<tr><td align="right"><input name="userAction" type = "submit" value="Login"/></td></tr>
		</table>
	</form>

	{% endif %}
	

</div>
<H2>Login Required</H2>

{% load url from future %}

{% block content %}

{% if form.errors %}
<p>Your username and password didn't match. Please try again.</p>
{% endif %}

<form method="post" action="{% url 'django.contrib.auth.views.login' %}">
{% csrf_token %}
<table>
<tr>
    <td><label for="id_username">Username</label></td>
    <td><input id="id_username" type="text" name="username" maxlength="30" /></td>
</tr>
<tr>
    <td><label for="id_password">Password</label></td>
    <td><input type="password" name="password" id="id_password" /></td>
</tr>
</table>

<input type="submit" value="login" />
<input type="hidden" name="next" value="{{ next }}" />
</form>

<br/>
<A HREF="/interview/register">Create a new account.</A>

{% endblock %}

</BODY>
</HTML>
